from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token

from users.views import MyObtainJSONWebToken
from . import views

urlpatterns =[
    url(r'^test/$', views.TestViews.as_view()),
    # 判断用户名的个数是否存在
    url(r'^usernames/(?P<username>\w{5,20})/count/$', views.UsernameCountView.as_view()),
    # 注册前判断手机号是否注册过
    url(r'^usermobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.UsermobileCountView.as_view()),

    # 注册用户（新增一个用户）
    url(r'^users/$', views.CreateUserView.as_view()),

    # 修改一个用户的（邮箱）
    url(r'^email/$', views.EmailView.as_view()),


    # 查询用户详情（查询一个用户）
    url(r'^user/$', views.UserDetailView.as_view()),

    # 登陆接口（使用第三方包的视图） obtain_jwt_token
    url(r'^authorizations/$', MyObtainJSONWebToken.as_view()),



]